import {createStore} from "redux"

// import logger from "redux-logger"
import {persistStore,persistReducer} from "redux-persist"
import storage from "redux-persist/lib/storage"
import reducer from "./reducer"

//持久化reducer
var persistedReducer = persistReducer({key:"redux",storage},reducer);


//applyMiddleware,createStore第二个参数中间件
// export default createStore(reducer,applyMiddleware(logger))
// var store =  createStore(persistedReducer)
var store =  createStore(persistedReducer)

//持久化仓库(store)
var persistor = persistStore(store)

export {
    store,
    persistor
}
